import { request } from '@/utils/request.js'

/**
 * 销售提成流水 API JS
 */

export default {

  /**
   * 获取销售提成流水分页列表
   * @returns
   */
  getList (params = {}) {
    return request({
      url: 'finance/bonus/index',
      method: 'get',
      params
    })
  },

  /**
   * 添加销售提成流水
   * @returns
   */
  save (data = {}) {
    return request({
      url: 'finance/bonus/save',
      method: 'post',
      data
    })
  },
  //批量添加
  saveBatch (id,data = {}) {
    return request({
      url: 'finance/bonus/saveBatch/'+id,
      method: 'post',
      data
    })
  },
  /**
   * 读取销售提成流水
   * @returns
   */
  read (id) {
    return request({
      url: 'finance/bonus/read/' + id,
      method: 'get',
    })
  },

  /**
   * 更新销售提成流水数据
   * @returns
   */
  update (data = {}) {
    return request({
      url: 'finance/bonus/update/' + data.id,
      method: 'put',
      data
    })
  },

  /**
   * 将销售提成流水删除，有软删除则移动到回收站
   * @returns
   */
  deletes (data) {
    return request({
      url: 'finance/bonus/delete',
      method: 'delete',
      data
    })
  },

  /**
   * 销售提成流水导出
   * @returns
   */
  exportExcel (params = {}) {
    return request({
      url: 'finance/bonus/export',
      method: 'post',
      responseType: 'blob',
      params
    })
  },

  /**
   * 从回收站获取销售提成流水数据列表
   * @returns
   */
  getRecycleList (params = {}) {
    return request({
      url: 'finance/bonus/recycle',
      method: 'get',
      params
    })
  },

  /**
   * 恢复销售提成流水数据
   * @returns
   */
  recoverys (data) {
    return request({
      url: 'finance/bonus/recovery',
      method: 'put',
      data
    })
  },

  /**
   * 真实删除销售提成流水
   * @returns
   */
  realDeletes (data) {
    return request({
      url: 'finance/bonus/realDelete',
      method: 'delete',
      data
    })
  },

    /**
   * 通过审计
   * @returns
   */
    auditPass (data = {}) {
      return request({
        url: 'finance/bonus/audit/pass',
        method: 'post',
        data
      })
    },
    /**
     * 反审计
     * @returns
     */
    auditRefuse (data = {}) {
      return request({
        url: 'finance/bonus/audit/refuse',
        method: 'post',
        data
      })
    },
  /**
   * 放入 账单
   * @returns
   */
  billIn (data = {}) {
    return request({
      url: 'finance/bonus/bill/in',
      method: 'post',
      data
    })
  },
  /**
   * 拿出 账单
   * @returns
   */
  billOut (data = {}) {
    return request({
      url: 'finance/bonus/bill/out',
      method: 'post',
      data
    })
  },

}